Added Console.other_config to the docs (Xend already has this).
authorEwan Mellor <ewan@xensource.com>
Tue, 20 Feb 2007 19:38:24 +0000 (19:38 +0000)
committerEwan Mellor <ewan@xensource.com>
Tue, 20 Feb 2007 19:38:24 +0000 (19:38 +0000)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
docs/xen-api/xenapi-datamodel.tex
tools/libxen/include/xen_console.h
tools/libxen/src/xen_console.c

index 70e2f417113c8e7258cfb734b04e135987b9b39e..d0fa4081fc9a6669f9ee69d86f7d3ceaae2a0725 100644 (file)
@@ -10887,6 +10887,7 @@ $\mathit{RO}_\mathit{run}$ &  {\tt uuid} & string & unique identifier/object ref
 $\mathit{RO}_\mathit{run}$ &  {\tt protocol} & console\_protocol & the protocol used by this console \\
 $\mathit{RO}_\mathit{run}$ &  {\tt location} & string & URI for the console service \\
 $\mathit{RO}_\mathit{run}$ &  {\tt VM} & VM ref & VM to which this console is attached \\
+$\mathit{RW}$ &  {\tt other\_config} & (string $\rightarrow$ string) Map & additional configuration \\
 \hline
 \end{longtable}
 \subsection{Additional RPCs associated with class: console}
@@ -11015,6 +11016,145 @@ VM ref
 
 
 value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_other\_config}
+
+{\bf Overview:} 
+Get the other\_config field of the given console.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} ((string -> string) Map) get_other_config (session_id s, console ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt console ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+(string $\rightarrow$ string) Map
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~set\_other\_config}
+
+{\bf Overview:} 
+Set the other\_config field of the given console.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} void set_other_config (session_id s, console ref self, (string -> string) Map value)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt console ref } & self & reference to the object \\ \hline 
+
+{\tt (string $\rightarrow$ string) Map } & value & New value to set \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+void
+}
+
+
+
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~add\_to\_other\_config}
+
+{\bf Overview:} 
+Add the given key-value pair to the other\_config field of the given
+console.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} void add_to_other_config (session_id s, console ref self, string key, string value)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt console ref } & self & reference to the object \\ \hline 
+
+{\tt string } & key & Key to add \\ \hline 
+
+{\tt string } & value & Value to add \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+void
+}
+
+
+
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~remove\_from\_other\_config}
+
+{\bf Overview:} 
+Remove the given key and its corresponding value from the other\_config
+field of the given console.  If the key is not in that Map, then do
+nothing.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} void remove_from_other_config (session_id s, console ref self, string key)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt console ref } & self & reference to the object \\ \hline 
+
+{\tt string } & key & Key to remove \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+void
+}
+
+
+
 \vspace{0.3cm}
 \vspace{0.3cm}
 \vspace{0.3cm}
index 778cbbb4e1b93de38f91d807c7689f6a16cabe69..ca4721c49d283527473c4c7aa3d5d17565dbb8ae 100644 (file)
@@ -22,6 +22,7 @@
 #include "xen_common.h"
 #include "xen_console_decl.h"
 #include "xen_console_protocol.h"
+#include "xen_string_string_map.h"
 #include "xen_vm_decl.h"
 
 
@@ -67,6 +68,7 @@ typedef struct xen_console_record
     enum xen_console_protocol protocol;
     char *location;
     struct xen_vm_record_opt *vm;
+    xen_string_string_map *other_config;
 } xen_console_record;
 
 /**
@@ -204,4 +206,35 @@ extern bool
 xen_console_get_vm(xen_session *session, xen_vm *result, xen_console console);
 
 
+/**
+ * Get the other_config field of the given console.
+ */
+extern bool
+xen_console_get_other_config(xen_session *session, xen_string_string_map **result, xen_console console);
+
+
+/**
+ * Set the other_config field of the given console.
+ */
+extern bool
+xen_console_set_other_config(xen_session *session, xen_console console, xen_string_string_map *other_config);
+
+
+/**
+ * Add the given key-value pair to the other_config field of the given
+ * console.
+ */
+extern bool
+xen_console_add_to_other_config(xen_session *session, xen_console console, char *key, char *value);
+
+
+/**
+ * Remove the given key and its corresponding value from the
+ * other_config field of the given console.  If the key is not in that Map,
+ * then do nothing.
+ */
+extern bool
+xen_console_remove_from_other_config(xen_session *session, xen_console console, char *key);
+
+
 #endif
index ea014db03e7da4afba11e09a85ad8986549ae123..0f61fdde6f34aca51ae6fd3b58716f4f7780f92a 100644 (file)
@@ -24,6 +24,7 @@
 #include "xen_console.h"
 #include "xen_console_protocol_internal.h"
 #include "xen_internal.h"
+#include "xen_string_string_map.h"
 #include "xen_vm.h"
 
 
@@ -49,7 +50,10 @@ static const struct_member xen_console_record_struct_members[] =
           .offset = offsetof(xen_console_record, location) },
         { .key = "VM",
           .type = &abstract_type_ref,
-          .offset = offsetof(xen_console_record, vm) }
+          .offset = offsetof(xen_console_record, vm) },
+        { .key = "other_config",
+          .type = &abstract_type_string_string_map,
+          .offset = offsetof(xen_console_record, other_config) }
     };
 
 const abstract_type xen_console_record_abstract_type_ =
@@ -73,6 +77,7 @@ xen_console_record_free(xen_console_record *record)
     free(record->uuid);
     free(record->location);
     xen_vm_record_opt_free(record->vm);
+    xen_string_string_map_free(record->other_config);
     free(record);
 }
 
@@ -197,6 +202,73 @@ xen_console_get_vm(xen_session *session, xen_vm *result, xen_console console)
 }
 
 
+bool
+xen_console_get_other_config(xen_session *session, xen_string_string_map **result, xen_console console)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = console }
+        };
+
+    abstract_type result_type = abstract_type_string_string_map;
+
+    *result = NULL;
+    XEN_CALL_("console.get_other_config");
+    return session->ok;
+}
+
+
+bool
+xen_console_set_other_config(xen_session *session, xen_console console, xen_string_string_map *other_config)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = console },
+            { .type = &abstract_type_string_string_map,
+              .u.set_val = (arbitrary_set *)other_config }
+        };
+
+    xen_call_(session, "console.set_other_config", param_values, 2, NULL, NULL);
+    return session->ok;
+}
+
+
+bool
+xen_console_add_to_other_config(xen_session *session, xen_console console, char *key, char *value)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = console },
+            { .type = &abstract_type_string,
+              .u.string_val = key },
+            { .type = &abstract_type_string,
+              .u.string_val = value }
+        };
+
+    xen_call_(session, "console.add_to_other_config", param_values, 3, NULL, NULL);
+    return session->ok;
+}
+
+
+bool
+xen_console_remove_from_other_config(xen_session *session, xen_console console, char *key)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = console },
+            { .type = &abstract_type_string,
+              .u.string_val = key }
+        };
+
+    xen_call_(session, "console.remove_from_other_config", param_values, 2, NULL, NULL);
+    return session->ok;
+}
+
+
 bool
 xen_console_get_uuid(xen_session *session, char **result, xen_console console)
 {